﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogisticsBLL;

namespace WebLosgic
{
    public partial class TruckDispatch : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindCarries();
            }
        }

        public void BindCarries()
        {
            int pageIndex = AspNetPagerTool.CurrentPageIndex;
            int pageSize = AspNetPagerTool.PageSize;
            int cout = 0;
            TruckDispathBLL trb = new TruckDispathBLL();
            RptBindDrive.DataSource = trb.TruckDisacth(pageIndex,pageSize,out cout);
            AspNetPagerTool.RecordCount = cout;
            RptBindDrive.DataBind();
        }

        protected void Btnxiang_Click(object sender, EventArgs e)
        {
            int CarriesID= Convert.ToInt32(((Button)sender).CommandArgument);
            Response.Redirect("../Carress/Carriesdetails.aspx?ID="+CarriesID);
        }

        protected void BtnDispatch_Click(object sender, EventArgs e)
        {
            int CarriesID = Convert.ToInt32(((Button)sender).CommandArgument);
            Response.Redirect("DDTrcuk.aspx?ID="+CarriesID);
        }

        protected void AspNetPagerTool_PageChanged(object sender, EventArgs e)
        {
            BindCarries();
        }
    }
}